
    <!DOCTYPE html>
    <html lang="zh-CN">
    <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>Spring整合Dubbo - 学习卡片</title>
      <style>
        body { font-family: sans-serif; background-color: #f0f8ff; color: #333; display: flex; flex-direction: column; align-items: center; padding: 50px 20px; }
        .header h1 { font-size: 32px; }
        .grid-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; width: 100%; max-width: 1200px; }
        .card-container { perspective: 1200px; cursor: pointer; height: 250px; }
        .card { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transition: transform 0.7s; border-radius: 16px; box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
        .card-container.flipped .card { transform: rotateY(180deg); }
        .card-face { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; display: flex; flex-direction: column; box-sizing: border-box; border-radius: 16px; background-color: #fff; padding: 24px; }
        .card-back { background-color: #f0fff4; transform: rotateY(180deg); justify-content: space-between; }
        .card-category { font-size: 14px; color: #0052d9; margin-bottom: 8px; font-weight: 500; }
        .card-question { font-size: 20px; font-weight: 500; flex-grow: 1; display: flex; align-items: center; justify-content: center; text-align: center; }
        .card-answer-wrapper { flex-grow: 1; overflow-y: auto; }
        .card-answer { font-size: 15px; line-height: 1.7; }
        .card-footer { font-size: 13px; color: #8a919f; border-top: 1px solid #f0f0f0; padding-top: 16px; margin-top: 16px; }
        .card-source { font-size: 13px; color: #8a919f; border-top: 1px solid #f0f0f0; padding-top: 12px; margin-top: 12px; }
      </style>
    </head>
    <body>
      <div class="header">
        <h1>Spring整合Dubbo - 学习卡片</h1>
      </div>
      <div class="grid-container">
        
    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">结构</div>
          <div class="card-question">根据文档，一个典型的 Dubbo 项目应该如何组织其 Maven 模块？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">结构</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">建议创建一个类型为 `pom` 的最外层 Maven 工程，然后在该工程下创建三个核心模块：`dubbo-interface` (定义服务接口)，`dubbo-provider` (提供服务实现)，和 `dubbo-comsumer` (调用服务)。</div>
          </div>
          <div class="card-source">来源: 1 创建工程</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">技术</div>
          <div class="card-question">在基于 Zookeeper 实现的 Dubbo 应用中，必须添加哪两个核心的 Maven 依赖？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">技术</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">必须添加 Dubbo 自身的依赖（例如 `com.alibaba:dubbo`）和 Zookeeper 客户端的依赖（例如 `com.github.sgroschupf:zkclient`）。</div>
          </div>
          <div class="card-source">来源: 2 添加依赖</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">配置</div>
          <div class="card-question">在服务提供者的 XML 配置中，`<dubbo:application>` 和 `<dubbo:registry>` 标签分别用于配置什么？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">配置</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">`<dubbo:application>` 用于配置服务名称（例如 `name="user_service"`），而 `<dubbo:registry>` 用于配置注册中心的地址（例如 `address="zookeeper://192.168.193.110:2181"`）。</div>
          </div>
          <div class="card-source">来源: 3.2 配置</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">实践</div>
          <div class="card-question">文档中展示的服务提供者是如何启动并使其持续运行以提供服务的？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">实践</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">通过编写一个包含 `main` 方法的类，使用 `new ClassPathXmlApplicationContext(...)` 来加载 Spring 和 Dubbo 的配置以初始化容器。同时，通过调用 `System.in.read()` 来阻塞主线程，防止程序立即退出。</div>
          </div>
          <div class="card-source">来源: 3.3 发布服务</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">配置</div>
          <div class="card-question">在服务调用者（Consumer）的 XML 配置中，`<dubbo:reference>` 标签的核心作用是什么？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">配置</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">它的核心作用是生成远程服务接口的代理对象。通过指定 `interface` 和 `id`，可以让这个远程服务像本地 bean 一样在 Spring 容器中被引用和注入。</div>
          </div>
          <div class="card-source">来源: 4.2 配置</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">实践</div>
          <div class="card-question">在服务调用者的测试代码中，是如何引用并调用远程服务的？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">实践</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">通过使用 `@Autowired` 注解，将`<dubbo:reference>`标签配置的服务接口代理（例如 `IUserService`）注入到测试类中，然后就可以直接调用其方法，如 `userService.add("admin")`。</div>
          </div>
          <div class="card-source">来源: 4.1 调用服务</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">技术</div>
          <div class="card-question">服务提供者的服务实现类（例如 `UserServiceImpl`）需要使用什么注解来暴露服务？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">技术</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">文档中的服务实现类 `UserServiceImpl` 使用了 `@Service` 注解来将其声明为服务。</div>
          </div>
          <div class="card-source">来源: 3.1 服务实现类</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">配置</div>
          <div class="card-question">在服务提供者的配置中，`<dubbo:annotation>` 标签的作用是什么？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">配置</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">`<dubbo:annotation>` 标签用于指定需要扫描注解的包路径，例如 `<dubbo:annotation package="com.qf.service"/>`，这样 Dubbo 才能发现并处理 `@Service` 等注解。</div>
          </div>
          <div class="card-source">来源: 3.2 配置</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">配置</div>
          <div class="card-question">服务调用者的 `<dubbo:consumer>` 标签可以用来配置哪些全局属性？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">配置</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">文档示例中，`<dubbo:consumer>` 标签被用来配置全局的消费者属性，例如 `cache="false"`（关闭缓存）和 `retries="3"`（失败重试次数）。</div>
          </div>
          <div class="card-source">来源: 4.2 配置</div>
        </div>
      </div>
    </div>

      </div>
    </body>
    </html>
